SET SESSION AUTHORIZATION 'lpd';

SET search_path = public, pg_catalog;
--
-- TOC entry 154 (OID 509056)
-- Name: lpd_get_prj_obj_count(integer, bigint); Type: FUNCTION; Schema: public; Owner: lpd
--

CREATE FUNCTION lpd_get_prj_obj_count(integer, bigint) RETURNS integer
    AS '
--version 0.1
--created by Postelnicu Mihai (mihai@code.ro)
DECLARE
       type_id ALIAS FOR $1;
       act_id ALIAS FOR $2;
        cnt integer;

BEGIN
     cnt:= COUNT(*) FROM objects WHERE obj_type=type_id AND activity_id=act_id;
     RETURN cnt;
END;
'
    LANGUAGE plpgsql;
